import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router'



const routes = [
  {
    path: '/',
    redirect: 'shouye'
  },
  {
    path: '/shouye',
    name: 'shouye',
    component: () => import('../views/shouye/index.vue')
  },
  {
    path: '/fenlei',
    name: 'fenlei',
    redirect: '/fenlei/kindlist',
    component: () => import('../views/fenlei/KindIndex.vue'),
    children: [{
      path: 'kindlist',
      name: 'kindlist',
      // meta: {
      //   hidden: true
      // },
      component: () => import('../views/fenlei/KindList.vue'),
    }, {
      path: 'kindpro',
      name: 'kindpro',
      meta: {
        hidden: true
      },
      component: () => import('../views/fenlei/KindPro.vue'),
    }
    ]
  },
  {
    path: '/gouwuche',
    name: 'gouwuche',
    component: () => import('../views/gouwuche/index.vue')
  },
  {
    path: '/wode',
    name: 'wode',
    redirect: '/wode/mylist',
    component: () => import('../views/wode/MyIndex.vue'),
    children: [{
      path: 'mylist',
      name: 'mylist',
      component: () => import('../views/wode/MyList.vue'),

    },
    {

      path: 'myorder',
      name: 'myorder',
      component: () => import('../views/wode/MyOrder.vue'),

    },

    ]

  },
  {
    path: '/sousuo',
    name: 'sousuo',
    component: () => import('../views/sousuo/index.vue'),
    meta: {
      // 配置路由的元信息
      hidden: false
    },
  },
  {
    path: '/message',
    name: 'message',
    component: () => import('../views/message/index.vue'),
    meta: {
      // 配置路由的元信息
      hidden: false
    },
  },
  {
    path: '/money',
    name: 'money',
    component: () => import('../views/money/index.vue'),
    meta: {
      // 配置路由的元信息
      hidden: false
    },
  },
  {
    path: '/servicee',
    name: 'servicee',
    component: () => import('../views/servicee/index.vue'),
    meta: {
      // 配置路由的元信息
      hidden: true
    },
  },
  {

    path: '/logistics',
    name: 'logistics',
    component: () => import('../views/logistics/index.vue'),
    meta: {
      // 配置路由的元信息
      hidden: true
    },

  },


  // --------登录接口------
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/login/index.vue'),
    meta: {
      // 配置路由的元信息
      hidden: true
    },
  },
  // ---注册接口--------
  {
    path: '/register',
    name: 'register',
    meta: {
      // 配置路由的元信息
      hidden: true
    },
    component: () => import('../views/register/index.vue'),
    // 路由重定向，默认打开第一个注册页面
    redirect: '/register/step1',
    children: [
      {
        path: 'step1',
        name: 'step1',
        component: () => import('../views/register/step1.vue'),
      },
      {
        path: 'step2',
        name: 'step2',
        component: () => import('../views/register/step2.vue'),
      },
      {
        path: 'step3',
        name: 'step3',
        component: () => import('../views/register/step3.vue'),
      }
    ]
  },
  // 用户个人信息
  {
    path: '/userinfo',
    name: 'userinfo',
    redirect: '/userinfo/one',
    meta: {
      // 配置路由的元信息
      hidden: true
    },
    component: () => import('../views/userinfo/index.vue'),
    // 路由重定向，默认打开第一个注册页面
    children: [
      {
        path: 'one',
        name: 'one',
        component: () => import('../views/userinfo/one.vue'),
      },
      {
        path: 'two',
        name: 'two',
        component: () => import('../views/userinfo/two.vue'),
      }
    ]
  },
  // 用户个人信息
  {
    path: '/address',
    name: 'address',
    redirect: '/address/addresslist',
    meta: {
      // 配置路由的元信息
      hidden: true
    },
    component: () => import('../views/address/AddressIndex.vue'),
    // 路由重定向，默认打开第一个注册页面
    children: [
      {
        path: 'addresslist',
        name: 'addresslist',
        component: () => import('../views/address/AddressList.vue'),
      },
      {
        path: 'changeaddress',
        name: 'changeaddress',
        component: () => import('../views/address/ChangeAddress.vue'),
      },
      {
        path: 'addaddress',
        name: 'addaddress',
        component: () => import('../views/address/AddressIndex.vue'),
      },
    ]
  },


]

const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes
})

export default router


































